NotExist = "<absent>"

def cmpdict(d1,d2):
    res = {}
    for k,v in d1.items():
        if k not in d2:
            res[k] = (d1[k],NotExist)
        elif d1[k] != d2[k]:
            res[k] = (d1[k], d2[k])
    for k,v in d2.items():
        if k not in d1:
            res[k] = (NotExist, d2[k])
    return res
            
def read_kv(s):
    res = {}
    for l in s.splitlines():
        k,v = l.split('=')
        res[k] = v
    return res
        
        
